{% extends "base.html" %}
{% load i18n imagequery_tags comments %}

{% block title %}{% trans "Profil | fha-django-gallery" %}{% endblock %}

{% block breadcrumbs %}
    {% blocktrans %}
        Sie befinden sich hier: <a href="/">fha-django-gallery</a> &raquo; 
        <a href="/account/profile/">Profil</a>
    {% endblocktrans %}
{% endblock %}

{% block content %}
    <h2>{{ user.username }}</h2>
    {% if user_profile.avatar %}
        <div class="image-index">
            <img src="{% image_format 'gallery_index' user_profile.avatar %}" alt="{{ user.username }}" />
        </div>
    {% endif %}
    {% if user_profile.description %}
        <p><strong>Beschreibung:</strong><br/>{{ user_profile.description }}</p>
    {% endif %}
    {% if user_profile.homepage %}
        <p><strong>Homepage:</strong> <a href="{{ user_profile.homepage }}">{{ user_profile.homepage }}</a></p>
    {% endif %}
    {% if user_profile.skype %}
        <p><strong>Skype:</strong> {{ user_profile.skype }}</p>
    {% endif %}
    {% if user_profile.homepage %}
        <p><strong>Wohnort:</strong> {{ user_profile.city }}</p>
    {% endif %}
    <div class="clear"></div>
    {% get_comment_count for user as comment_count %}
    <h3>Kommentare ({{ comment_count }}):</h3>
    {% get_comment_list for user as comment_list %}
    {% for comment in comment_list %}
        <div class="comment">
            <div class="comment-head">
                <h2>{{ comment.user_name }}</h2>
                <p>am {{ comment.submit_date }}</p>
            </div>
            <div class="comment-content">
                <p>{{ comment.comment }}</p>
            </div>
        </div>
    {% endfor %}
    <h3>Kommentar eintragen:</h3>
    {% get_comment_form for user as form %}
    <form action="{% comment_form_target %}" method="POST">
        {% csrf_token %}
        {% include "common/forms/display_form.html" %}
        {% with "Kommentieren" as submit_text %}
            {% include "common/forms/display_form_submit.html" %}
        {% endwith %}
    </form>
{% endblock %}
